package com.atguigu.spring5.textdemo;

import com.atguigu.spring5.textdemo.config.SpringConfig;
import com.atguigu.spring5.textdemo.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring5Demo1 {
    @Test
    public void testService(){
        ApplicationContext context=new ClassPathXmlApplicationContext("bean1.xml");
        UserService userService=context.getBean("userService",UserService.class);
        userService.add();
    }
    @Test
    public void testService2(){
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService=context.getBean("userService",UserService.class);
        userService.add();

        //测试更新
        //测试更新
        //测试更新
        //测试更新

        userService.add();
        //分支提交
    }
}
